package www.wackyboy.top.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import www.wackyboy.top.Dept;
import www.wackyboy.top.service.IDeptService;

@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private IDeptService deptService;

    @GetMapping("/showInfo")
    public ResponseEntity<Dept> showInfoByDeptId(@RequestParam("deptId") String deptId) {
        System.out.println(deptId);
        Dept dept = this.deptService.searchDeptInfoById(Integer.parseInt(deptId));
        return ResponseEntity.ok(dept);
    }

}
